package moe.oil.db.repo;

import moe.oil.db.entity.UserTarget;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Optional;

/**
 * Created with IntelliJ IDEA.
 * author: 紫月
 * Date: 2022/04/16 16:49
 * Description:
 *
 * @author - -
 */
public interface UserTargetRepo extends PagingAndSortingRepository<UserTarget, Long> {

    // 根据用户id查询用户目标
    Optional<UserTarget> findByTargetId(Long targetId);

    // 查询全部用户目标  分页

    Page<UserTarget> findAll(Pageable pageable);

    // 删除用户目标
    int deleteByTargetId(Long targetId);
}
